package eleven;
import java.util.Scanner;

public class ScannerDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        // 从键盘接收数据

        float f = 0.0f;
        int sum = 0;
        System.out.print("输入整数：");
        while (scan.hasNextInt()) {
            // 判断输入的是否是整数
            int i = scan.nextInt();
            sum = sum+i;
            // 接收整数
            System.out.println("整数数据：" + i);
        }


        System.out.println("总和:"+sum);
        scan.close();
    }
}
